﻿using Shop.Data.Entities;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shop.Data.Mapping
{
   public class ProductoMapping : EntityTypeConfiguration<Producto>
    {
         public ProductoMapping()
        {
            ToTable("Productos");

            HasKey(t => t.Id);
            Property(t=> t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            Property(t => t.nombre).IsRequired();
            Property(t => t.descripcion).IsOptional();
            Property(t => t.stock).IsOptional();
        }
    }
}
